import request from '../utils/request.js'

// 获取账号详情,这个很奇怪,返回的结果没东西,还有就是为啥不用传参数啊
// 2022.5.24 携带cookie之后就不需要传参数了,因为服务器认得cookie,返回自己账号信息
export const getAccount = () => {
  return request({
    method: 'GET',
    url: '/user/account'
  })
}

// 获取用户详情,可用于看别的用户主页
export const getUserDetail = (uid) => {
  return request({
    method: 'GET',
    url: '/user/detail',
    params: { uid }
  })
}

// 获取用户信息 , 歌单，收藏，mv, dj 数量
export const getUserSubcount = () => {
  return request({
    method: 'GET',
    url: '/user/subcount'
  })
}

// 获取用户歌单
export const getUserPlayList = (uid, limit, offset) => {
  return request({
    method: 'GET',
    url: '/user/playlist',
    params: { uid, limit, offset }
  })
}
